package main

import (
	"log"
	"fmt"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/ethclient"
)

func main(){
	//1. dial
	cli, err := ethclient.Dial("http://localhost:8545")
	if err != nil {
		log.Fatal("failed to conn to geth", err)
	}
	//2. 入口
	instance, err := NewHotel(common.HexToAddress("0x3bf48bb97053b09080a2b4c38f6b612774cf1a25"), cli)
	if err != nil {
		log.Fatal("failed to get instance", err)
	}
	//3. 调用
	flag, err := instance.Query(nil, "12345")
	if err != nil {
		log.Fatal("failed to query", err)
	}
	fmt.Println(flag)
}
